package com.cw.config;

/**
 * @author Nice_BernardShaw
 * @date 2023/3/31 0:00
 */

public class BaseContext {
    //定义一个Threadlocal
    private static  ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    //设置值
    public   static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    //获取自己线程存的值
    public  static Long getCurrentId(){
        return threadLocal.get();
    }
}
